//***************************************************************
//  File:    GameObject.cpp
//  Date:    12/17/2012
//  Author:  liangxc (liangxc2010@gmail.com)
//-------------------------------------------------------------
//
//-------------------------------------------------------------
//  This file is part of Hare2D Game Engine.
//  Copyright (C) All Rights Reserved
//***************************************************************
//
//***************************************************************
#ifndef __GAMEOBJECTPAGE_H__
#define __GAMEOBJECTPAGE_H__

#include <wx/harecanvas.h>

class SceneMIMEHandler;

class GameObjectPage : public EditorPage
{
	DECLARE_ABSTRACT_CLASS(GameObjectPage)
public:
	GameObjectPage(wxWindow* parent, SceneMIMEHandler* handler);
	virtual ~GameObjectPage();

	virtual void setModified(bool modified);
	virtual bool getIsModified() const { return isModified; }
	virtual bool save();
	bool saveAs();

	void renderScene();

	void setGameObject(GameObject* obj);

	void updateTitle();

protected:
	void onSize(wxSizeEvent& event);
	void onLButtonDown(wxMouseEvent& event);
	void onLButtonUp(wxMouseEvent& event);
	void onMouseMove(wxMouseEvent& event);
	void onRButtonDown(wxMouseEvent& event);

	void onMenuSelected(wxCommandEvent& event);
private:
	wxPoint mousePos;

protected:
	SceneMIMEHandler* mime;
	wxHareCanvas* canvas;
	SceneManager* scene;

	GameObject::Ptr gameObj;

	bool isModified;
};


#endif